let data={
    msg:{
        name:'fangni',
        id:'1903010111',
        class:'19应用3-1班'
        },
    ImaColor:['#FFB6C1','#FFC0CB','#DC143C','#FFF0F5'],
    ImgSrc:['1.jpg','2.jpg','3.jpg','4.jpg']
}
console.log(data)

let ClassEle=document.getElementsByClassName('itemdiv')
console.log(ClassEle)

let MsgEle=document.querySelectorAll('#div1 .itemdiv')
console.log(MsgEle)
MsgEle[0].textContent=data.msg.class
MsgEle[1].textContent=data.msg.id
MsgEle[2].textContent=data.msg.name

//let ColorEle=document.querySelectorAll('#div2 .itemdiv')
//console.log(ColorEle)
//ColorEle[0].style.background=data.ImaColor[0]
//ColorEle[1].style.background=data.ImaColor[1]
//ColorEle[2].style.background=data.ImaColor[2]
//ColorEle[3].style.background=data.ImaColor[3]

let ColorEle=document.querySelectorAll('#div2 .itemdiv')
console.log(ColorEle)
for (let i=0;i<ColorEle.length;i++){
    ColorEle[i].style.background=data.ImaColor[i]
}

let Ele=document.querySelectorAll('#div3 div')
for(let i=0;i<data.ImgSrc.length;i++){
    let PhotoEle=document.createElement('img')
    PhotoEle.src=data.ImgSrc[i]
    Ele[i].textContent=''
    Ele[i].appendChild(PhotoEle)
}

